<?php

	/**
	* Edit Logo at the top
	* for project CMS Koray
	* @author trungdt
	* @since June 3
	* @copyright Absoft Viet Nam
	*/
	if (!defined('EXPONENT')) exit('');
	
	if (exponent_users_isAdmin()) {
        $LANG = LANG;
        $sql_where = "lang_name='{$LANG}'";
		$logo = $db->selectObject('sitelogo',"{$sql_where}");
		if (!defined('SYS_FORMS')) require_once(BASE.'subsystems/forms.php');
		exponent_forms_initialize();
		
		$form = new form();
		
		if (!isset($logo->content)) {
			$logo->content = "";
            $logo->file_id = 0;
			$logo->scale_font = 100;
		}
		$form->register('content',"HTML content",new texteditorcontrol($logo->content,5,60,true));
        $form->register('file_id','Logo file', new ajax_select_file('file_id',0,$logo->file_id,true));
		$form->register('scale','Scale font size', new htmlcontrol('<input class="easyui-numberspinner"  name="font_scale" id="font_scale" min="10" max="500" required="true" style="width:50px;" value="'.$logo->scale_font.'" ></input>%
', false));
        $form->register("scale_js",null,new htmlcontrol("<script language='javascript'>
        jQuery(document).ready(function(){ jQuery('#font_scale').attr('disabled','disabled'); });
        </script>"));
        $form->register('footer',"Footer Copyright",new texteditorcontrol($logo->footer,5,60,true));
        
		$form->register('submit','',new buttongroupcontrol("Save",'',"Cancel"));
		
		$form->meta('action','logo_save');
		$form->meta('_common',1);
		$form->meta('module',"sysnavmodule");
        $lang = exponent_lang_list();
		$template = new template('administrationmodule','_logo_edit',$loc);
		$template->assign('form_html',$form->toHTML());
		$template->output();
	} else {
		echo SITE_403_HTML;
	}

?>